import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home/index.vue'
import Crat from '../views/Crat/index.vue'
import Friend from '../views//Friend/index.vue'
import Search from '../views/Search/index.vue'
import NewsList from '../views/Home/news/NewsList/index.vue'
import NewsInfo from '../views/Home/news/NewsInfo/index.vue'
import PhotoList from '../views/Home/photos/PhotoList'
import PhotoInfo from '../views/Home/photos/PhotoInfo'
import GoodList from '../views/Home/goods/GoodList'
import GoodInfo from '../views/Home/goods/GoodInfo'

Vue.use(VueRouter)
const routes = [
  {
  path: '/',
  redirect:'/home',
  meta:{
    active:0,
    title:'home'
  }
  },
  {
  path: '/home',
  component: Home,
  meta:{
    active:0,
    title:'home'
  }
},
{
  path: '/crat',
  component: Crat,
  meta:{
    active:1,
    title:'crat'
  }
},
{
  path: '/friend',
  component: Friend,
  meta:{
    active:2,
    title:'friend'
  }
},
{
  path: '/search',
  component: Search,
  meta:{
    active:3,
    title:'search'
  }
},
{
  path:'/home/newslist',
  component:NewsList,
  meta:{
    title:'新闻列表'
  }
},
{
  path:'/home/newsinfo/:id',
  component:NewsInfo,
  props:true,
  meta:{
    title:'新闻详情'
  }
},
{
  path:'/home/photolist',
  component:PhotoList,
  meta:{
    title:'图片列表'
  }
},
{
  path:'/home/photoinfo/:id',
  component:PhotoInfo,
  props:true,
  meta:{
    title:'图片详情'
  }
},
{
  path:'/home/goodslist',
  component:GoodList,
  meta:{
    title:'商品列表'
  }
},
{
  path:'/home/goodsinfo/:id',
  component:GoodInfo,
  props:true,
  meta:{
    title:'商品详情'
  }
}

]
const router = new VueRouter({
  routes
})

export default router
